package demo.dao;

import cn.wenxin_zhang.smart4j.plus.annotation.*;
import demo.entity.SysUser;

import java.util.List;

/**
 * Created by Wenxin on 2017/3/13.
 */
@Mapper
public interface SysUserDao {

    @Select("select id,username,password from sys_user where id = ?")
    public SysUser query(long id);

    @Select("select id,username,password from sys_user where username = ?")
    public SysUser query(String username);

    @Select("select id,username,password from sys_user limit ?,?")
    public List<SysUser> queryList(int start, int size);

    @Insert("insert into sys_user(username,password)value(?,?)")
    public int insert(String username, String password);

    @Update("update sys_user set username = ?, password = ? where id = ?")
    public int update(String username, String password,long id);

    @Update("update sys_user set password = ? where id = ?")
    public int update(String password,long id);

    @Delete("delete from sys_user where id = ?")
    public int delete(long id);

}
